using System.Collections;
using Anvil.Core;

namespace Anvil.Core.Commands
{
	/// <summary>
	/// Run the query indicated by QueryID, and return the result as an IList.
	/// </summary>
	/// <remarks><p>
	/// Originally, this class did more work. 
	/// Now, it is very simple form of the BaseList command 
	/// (which now does quite a bit of other work).
	/// </p>
	/// </remarks>
	public class BaseKeyList : BaseMapper
	{
		public override bool RequestExecute(IRequestContext context)
		{
			IList rows = Mapper.QueryForList(QueryID, context);
			context[ID] = rows; // Command ID *not* QueryID
			return CONTINUE;
		}
	}
}